const User = {
  // 查询用户名
  queryUserName(params) {
    return 'select * from user where userName=' + params.username + ''
  },
  // 确定密码
  queryUserPwd(params) {
    return 'select * from user where (userName=' + params.username + ') and passWord=' + params.password + ''
  },
  //添加用户
  inserData(params) {
    let username = params.username
    let password = params.password
    let email = params.email
    //引入token包
    let jwt = require('jsonwebtoken')
    let payload = {userName: username}
    let secret = 'zhongyu'
    let token = jwt.sign(payload, secret)
    return 'insert into user (userName,passWord,token,email,create_time,mg_state,role_name) values ("' + username + '","' + password + '","' + token + '","' + email + '",CURDATE(),"false","业务员")';
  }
}
exports=module.exports = User